
def queryPackage(li):
    reli = []
    reli1 = []
    for i in range(0, len(li)):
        if 0 == i:
            reli1.append(li[0:1])
        else:
            reli1.append(li[i])
    reli.append(reli1)

    if len(li) > 2:
        for i in range(0, len(li)):
            reli1 = []
            reli1.append(li[i:i+1])
            reli1.append(li[i+1:]+li[0:i])
            reli.append(reli1)

    if len(li) > 3:
        for i in range(0, len(li)):
            reli1 = []
            if i+1 < len(li):
               reli1.append(li[i:i+1])
               reli1.append(li[i+1:i+2])
               reli1.append(li[i+2:]+li[0:i])
               reli.append(reli1)

            

    if len(li) > 1:
        reli1 = [li]
        reli.append(reli1)

    reli2=[]
    for i in reli:
        if i not in reli2:
            reli2.append(i)
    return reli2


z = queryPackage ('abcd')

print( z )

